package close.mazegame.screens;

import close.mazegame.art.MiscArt;
import close.mazegame.input.uiinput.UIInput.UIKeys;
import close.mazegame.InputHandler;
import close.mazegame.MazeGame;

public class TitleScreen extends Screen {

	private float y = 320.0f;

	@Override
	public void render() {
		spriteBatch.begin();
		draw(MiscArt.bg, 0, 0, MazeGame.WIDTH, MazeGame.HEIGHT);
		draw(MiscArt.title, 0, y, MazeGame.WIDTH, MazeGame.HEIGHT);

		if (y == 0) {
			String msg = "PRESS SOMETHING YOU PUTZ";
			drawString(msg, MazeGame.WIDTH / 2 - (msg.length() * 8),
					MazeGame.HEIGHT / 4, 2);
		}

		if (y == 0) {
			String msg = "COPYRIGHT ME I GUESS";
			drawString(msg, 0, 9, 1);
		}
		spriteBatch.end();
	}

	@Override
	public void update(float delta) {
		y -= 160 * delta;
		if (y < 0) {
			y = 0;
		}
		if (y == 0) {
			if (InputHandler.uiInput.isTyped(UIKeys.UI_ENTER)) {
				setScreen(new MenuScreen());
			}
		} else {
			if (InputHandler.uiInput.isTyped(UIKeys.UI_ENTER)) {
				y = 0;
			}
		}
	}

	@Override
	public boolean isOverlay() {
		return false;
	}

}
